<?php
/**
 * Joomla! 1.5 component Bbits Simple directory
 *
 * @version $Id: view.html.php 2011-07-08 03:53:16 svn $
 * @author Miguel Puig
 * @URL http://miguelpuig.com
 * @package Joomla
 * @subpackage Bbits Simple directory
 * @license GNU/GPL
 *
 * Simple Directory by bittingbits.com
 *
 *
 */
// no direct access
defined('_JEXEC') or die('Restricted access');

jimport( 'joomla.application.component.controller' );
require_once( JPATH_COMPONENT.DS.'helpers'.DS.'helper.php' );

class BbitsdController extends JController {
    /**
     * Constructor
     * @access private
     * @subpackage Bbits Simple directory
     */
    function __construct() {
        //Get View
        if(JRequest::getCmd('view') == '') {
            JRequest::setVar('view', 'items');
        }
        $this->item_type = 'Default';
        parent::__construct();
    }
    
    
   	function types()
    {
        JRequest::setVar('view', 'types');
        parent::display();
    }
    function continents()
    {
    
        JRequest::setVar('view', 'groups');
        parent::display();
    }
    function groups()
    {
        JRequest::setVar('view', 'groups');
        parent::display();
    }
    function countries()
    { 

		$view = & $this->getView( 'countries', 'html' );
		$view->setModel( $this->getModel( 'countries' ), true );
		$view->setModel( $this->getModel( 'groups' ) );
		$view->display();
     
    }
    
    function items()
    { 
		
		$view = & $this->getView( 'items', 'html' );
		$view->setModel( $this->getModel( 'items' ), true );
		$view->setModel( $this->getModel( 'groups' ) );
		$view->setModel( $this->getModel( 'countries' ) );
		$view->setModel( $this->getModel( 'types' ) );
		$view->display();
     
    }

}
?>
